//
//  XSButton.h
//  writemall
//
//  Created by mac on 2021/7/14.
//  Copyright © 2021 p.write.mall. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class XSButton;

/**重定义 */
typedef void (^YSBlockButton)(XSButton *YSBtn);


typedef NS_ENUM(NSUInteger, XSButtonEdgeInsetsStyle) {
    XSButtonEdgeInsetsStyleImageTop, // image在上，label在下
    XSButtonEdgeInsetsStyleImageLeft, // image在左，label在右
    XSButtonEdgeInsetsStyleImageBottom, // image在下，label在上
    XSButtonEdgeInsetsStyleImageRight, // image在右，label在左
    XSButtonEdgeInsetsStyleImageCenter//image图片居中,无文字
};



@interface XSButton : UIButton

@property(nonatomic,assign)NSInteger colTag;

@property(nonatomic,assign)NSInteger rowTag;


- (void)changeVerfiyButtonState;
/**
 *自定义一个button用block替换button点击方法（BSBlockButton 对象调用 addTap...方法）
 */
@property(nonatomic,copy)YSBlockButton block;



/**添加实现方法 这里要注意在block引用self的变量时 要用weak属性*/
- (void)addTapRunWithBlock:(YSBlockButton)block;



/**
 *  设置button的titleLabel和imageView的布局样式，及间距
 *
 *  @param style titleLabel和imageView的布局样式
 *  @param space titleLabel和imageView的间距
 */
- (void)layoutButtonWithEdgeInsetsStyle:(XSButtonEdgeInsetsStyle)style
                        imageTitleSpace:(CGFloat)space;


/**  快捷获取button*/
+ (XSButton *)getButtonSuperView:(id)superView rect:(CGRect)rect text:(NSString *)text textColor:(UIColor *)color font:(UIFont *)font;

@end


NS_ASSUME_NONNULL_END
